package com.cskaoyan.aspect.wx_user;

import com.cskaoyan.bean.wx_brand.base.BrandParam;
import com.github.pagehelper.PageHelper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author liXiaoFei
 * @date 2021/10/19 17:35
 */

@Aspect
@Component
public class WxBrandAspect {

    @Pointcut("execution(* com.cskaoyan.service.wx_brand..queryBrand(..))")
    public void brandQueryPointcut(){
    }


    @Around("brandQueryPointcut()")
    public Object aroundBrandQueryBrand(ProceedingJoinPoint joinPoint) throws Throwable {
        Object[] args = joinPoint.getArgs();
        BrandParam brandParam = (BrandParam) args[0];
        PageHelper.startPage(brandParam.getPage(),brandParam.getLimit());
        return joinPoint.proceed();
    }




}
